package com.ruoyi.driver.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.driver.mapper.CarownerMiddleMapper;
import com.ruoyi.driver.domain.CarownerMiddle;
import com.ruoyi.driver.service.ICarownerMiddleService;

/**
 * 车辆和路线中间Service业务层处理
 * 
 * @author Wevon
 * @date 2024-08-15
 */
@Service
public class CarownerMiddleServiceImpl implements ICarownerMiddleService 
{
    @Autowired
    private CarownerMiddleMapper carownerMiddleMapper;

    /**
     * 查询车辆和路线中间
     * 
     * @param carDetialsId 车辆和路线中间主键
     * @return 车辆和路线中间
     */
    @Override
    public CarownerMiddle selectCarownerMiddleByCarDetialsId(Long carDetialsId)
    {
        return carownerMiddleMapper.selectCarownerMiddleByCarDetialsId(carDetialsId);
    }

    /**
     * 查询车辆和路线中间列表
     * 
     * @param carownerMiddle 车辆和路线中间
     * @return 车辆和路线中间
     */
    @Override
    public List<CarownerMiddle> selectCarownerMiddleList(CarownerMiddle carownerMiddle)
    {
        return carownerMiddleMapper.selectCarownerMiddleList(carownerMiddle);
    }

    /*根据车主ID查询路线*/
    public List<CarownerMiddle> selectByCarOwnerId(Long carOwnerId){
        return carownerMiddleMapper.selectByCarOwnerId(carOwnerId);
    }

    /**
     * 新增车辆和路线中间
     * 
     * @param carownerMiddle 车辆和路线中间
     * @return 结果
     */
    @Override
    public int insertCarownerMiddle(CarownerMiddle carownerMiddle)
    {
        return carownerMiddleMapper.insertCarownerMiddle(carownerMiddle);
    }

    /**
     * 修改车辆和路线中间
     * 
     * @param carownerMiddle 车辆和路线中间
     * @return 结果
     */
    @Override
    public int updateCarownerMiddle(CarownerMiddle carownerMiddle)
    {
        return carownerMiddleMapper.updateCarownerMiddle(carownerMiddle);
    }

    /**
     * 批量删除车辆和路线中间
     * 
     * @param carDetialsIds 需要删除的车辆和路线中间主键
     * @return 结果
     */
    @Override
    public int deleteCarownerMiddleByCarDetialsIds(Long[] carDetialsIds)
    {
        return carownerMiddleMapper.deleteCarownerMiddleByCarDetialsIds(carDetialsIds);
    }

    /**
     * 删除车辆和路线中间信息
     * 
     * @param carDetialsId 车辆和路线中间主键
     * @return 结果
     */
    @Override
    public int deleteCarownerMiddleByCarDetialsId(Long carDetialsId)
    {
        return carownerMiddleMapper.deleteCarownerMiddleByCarDetialsId(carDetialsId);
    }
}
